import { MockMethod } from "vite-plugin-mock";
import Mock from "mockjs";
import { ref } from "vue";
let idCounter = ref(1);
let desId = ref(1);
function generateUserData(): { id: number; description: string } {
    return {
        id: idCounter.value++,
        description: `这是一段美丽的描述` + desId.value++,
    };
}
export default [
    {
        url: "/api/scrollList",
        method: "get",
        timeout: 200,
        response: ({ query }: { query: any }) => {
            idCounter.value = 0;
            desId.value = 0;
            return {
                code: 200,
                message: "ok",
                // data: require("../data/scrollData").users,
                data: Array.from({ length: 10 }, generateUserData),
            };
        },
    },
] as MockMethod[];
